Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worklet Improvents / fixes #963

Merged
merged 15 commits into from
Mar 4, 2024
Merged

Conversation

daslyfe
Copy link
Collaborator

@daslyfe daslyfe commented Feb 28, 2024

These are fixes for the shape/crush/coarse worklets

  • all are now stereo fx
  • shape now has an optional "postgain" param when using array syntax: "shape("8:.5")"
  • coarse works predictably on non chromium
  • coarse and crush fx no longer go silent when inputting 0
  • Added a distort worklet, which is the same as shape but with a much safer/gradual input curve

@felixroos
Copy link
Collaborator

nice! is the shape range now very different / would this change existing patterns using shape audibly?

@daslyfe
Copy link
Collaborator Author

daslyfe commented Feb 28, 2024

nice! is the shape range now very different / would this change existing patterns using shape audibly?

yes before 0 -.8 was the usable range. Now it is 0-10 and the exponential curve of the shape param input is different/more predictable. my experience with the prior curve would be that you can carefully adjust it to .8ish or so, but once you hit .9-1 it would blow up your speakers which is very bad for live improvising

@felixroos
Copy link
Collaborator

yep shape is dangerous :D I just worry about the breaking change, so maybe find a new name and keep the existing shape as is? iirc the shape of tidal also has a range between 0 and 1 with a similar explosive behavior.
not sure if i like the range between 0 and 10 because it does not play as well with normalized values.

@daslyfe
Copy link
Collaborator Author

daslyfe commented Feb 28, 2024

yep shape is dangerous :D I just worry about the breaking change, so maybe find a new name and keep the existing shape as is? iirc the shape of tidal also has a range between 0 and 1 with a similar explosive behavior. not sure if i like the range between 0 and 10 because it does not play as well with normalized values.

I adjusted it so 0 - 1 goes from not distorted to very distorted in a linear fashion. if you want to be more extreme you can continue to go above 1. Would that be a decent compromise? It could still affect the sound of patterns that use shape slightly but it makes the function a lot more useful imo. I can also create another version called shape2 or something like that :)

I think a somewhat-breaking change like this is justifed here to protect people's ears (especially in a live setting)

@felixroos
Copy link
Collaborator

I also agree that a more linear distortion curve is very desirable, it might still make sense to add it as an alias because it changes the mix of a lot of existing stuff + keeping parity with tidal is generally a good thing. Maybe just call it distort or shapelin (or both) ?

@daslyfe
Copy link
Collaborator Author

daslyfe commented Feb 28, 2024

I also agree that a more linear distortion curve is very desirable, it might still make sense to add it as an alias because it changes the mix of a lot of existing stuff + keeping parity with tidal is generally a good thing. Maybe just call it distort or shapelin (or both) ?

Okay I updated it and added another processor to keep shape behavior the same. New processor is called distort, but has a shorthand of dist. It has a much more gradual and predictable curve

@@ -457,7 +458,14 @@ export const superdough = async (value, deadline, hapDuration) => {
// effects
coarse !== undefined && chain.push(getWorklet(ac, 'coarse-processor', { coarse }));
crush !== undefined && chain.push(getWorklet(ac, 'crush-processor', { crush }));
shape !== undefined && chain.push(getWorklet(ac, 'shape-processor', { shape }));
if (shape !== undefined) {
const input = Array.isArray(shape) ? { shape: shape[0], postgain: shape[1] } : { shape };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a built in way to define controls that may be an array:

export const { shape } = registerControl(['shape','postgain']);

this will automatically define shape and postgain in the hap value when ":" notation is used, so this should be enough:

shape !== undefined && chain.push(getWorklet(ac, 'shape-processor', { shape, postgain }));

same can be done for distortion

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, I updated it but instead of using "postgain" I used shapevol and distortvol because postgain is already the name of a different control.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is ready to go again

@daslyfe daslyfe merged commit 5241090 into tidalcycles:main Mar 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants